package Demo01.File;

//public boolean mkdir(); 创建单级文件夹
//public boolean mkdirs(); 创建多级文件夹，也可以创建单级文件夹

import java.io.File;
import java.io.IOException;

public class Demo05File {
    public static void main(String[] args) throws IOException {
//        show01();
        show02();
//        File f2 = new File("AuI18N\\2052\\2.txt");
//        boolean b2 = f2.createNewFile();
//        System.out.println(f2.createNewFile());
    }

    private static void show02() {
        File f1 = new File("C:\\新建文件夹\\QQ\\QQ\\AuI18N\\2052\\aaa");
//        boolean b1 = f1.mkdir();
//        System.out.println(b1);

        File f2 = new File("C:\\新建文件夹\\QQ\\QQ\\AuI18N\\2052\\111\\222");
//        boolean b2 = f2.mkdirs();
//        System.out.println(b2);

        boolean b3 = f1.delete();
        System.out.println(b3);
        boolean b4 = f2.delete();
        System.out.println(b4);
    }

    private static void show01() throws IOException {
        File f1 = new File("C:\\新建文件夹\\QQ\\QQ\\AuI18N\\2052\\1.txt");
        boolean b1 = f1.createNewFile();
        System.out.println("b1:" + b1);
//        boolean b2 = f1.delete();
//        System.out.println(b2);
    }
}
